var Crawler = require("crawler");
var jsDom = require('jsdom');
var strategys = require('./strategys');
/*var url = require('url');*/

var engine = new Crawler({
    maxConnections: 10,
    jQuery: jsDom,
    // This will be called for each crawled page
    callback: function (error, res, done) {
        if (error) {
            console.log(error);
        } else {
            var $ = res.$;
            console.log($("title").text());
        }
        done();
    }
});

exports.startCrawler = engine.queue(strategys);

